namespace ODT.Intellisense.Models
{
	public static class LocalQuery
	{
		public const string AliasQuery = "Select alias from software_tbl0 where software_tbl0.command like ?word";

		public const string HelpQuery0 = "SELECT software_tbl0.Comments FROM software_tbl0 WHERE software_tbl0.Command =?suggestion";

		public const string HelpQuery1 = "SELECT software_tbl1.Comments FROM software_tbl1 WHERE software_tbl1.Command = ?suggestion";

		public const string HelpQuery2 = "SELECT software_tbl2.Comments FROM software_tbl2 WHERE software_tbl2.Command = ?suggestion";

		public const string Level0Query0 = "SELECT software_tbl0.Command FROM software_tbl0 where UserLevel < 4 order by Command";

		public const string Level0Query1 = "SELECT Name FROM userprog where Type like 'PROG' or Type like 'SUBPROG' or Type like 'PLC' order by Name";

		public const string UserTableQuery = "SELECT Name,Type FROM userglobal where Type like 'Ptr' or Type like 'Global' or Type like 'Csglobal' or Type like 'UserDefine'";

		public const string Level1Query0 = "SELECT Command FROM software_tbl1 WHERE commandID LIKE ?level1Command and UserLevel < 4 ORDER BY Command";

		public const string Level1Query1 = "SELECT Name FROM userprog WHERE userprog.Type LIKE ?level1Command";

		public const string Level1Query2 = "SELECT Name FROM userglobal Where userglobal.Type LIKE ?level1Command";

		public const string Level2Query2 = "Select userlocal.Name from userlocal,userprog where userlocal.ProgId = userprog.ProgId and Match(userprog.ProgID) Against('' In Boolean Mode)";

		public const string Level2Query0 = "SELECT software_tbl2.Command FROM software_tbl1, software_tbl2 WHERE  software_tbl1.Command = software_tbl2.CommandId AND software_tbl1.Command = ?level2Command and software_tbl1.commandID = ?level1Command and (CASE WHEN software_tbl2.GateChan = 'NULL' THEN software_tbl2.GateChan = 'NULL'  ELSE software_tbl2.GateChan = ?level1Command1 END ) and software_tbl2.UserLevel < 4 Order By software_tbl2.Command";

		public const string Level2Query0GateChan = "SELECT software_tbl2.Command FROM software_tbl1, software_tbl2 WHERE software_tbl1.Command = software_tbl2.CommandId AND Match(software_tbl1.Command)Against(?level2Command In Boolean Mode) and software_tbl1.commandID =?level1Command and software_tbl2.GateChan = ?level1Command1 and software_tbl2.UserLevel < 4 Order By software_tbl2.Command";

		public const string Level2Query1 = "Select userlocal.Name from userlocal,userprog where userlocal.ProgId = userprog.ProgId and Match(userprog.ProgID) Against(CONCAT(?level1Command,?level2Command) In Boolean Mode)";

		public const string Level3Query0 = "SELECT software_tbl3.Command FROM software_tbl1, software_tbl2, software_tbl3  WHERE  software_tbl1.Command = software_tbl2.CommandId AND software_tbl1.Command = ?level2Command and software_tbl1.commandID = ?level1Command AND software_tbl2.Command = software_tbl3.CommandId AND  software_tbl2.Command = ?level3Command AND  software_tbl2.commandID = ?level2Command1 and software_tbl3.UserLevel < 4 Order By software_tbl3.Command";
	}
}
